package com.base.vistter.iframe.model;

import com.base.vistter.iframe.properties.InverterProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class EconomyResponse implements Serializable {

    private Float coal;

    private Float co2;

    private Float tree;

    private Float earnings;

    public EconomyResponse(Float totalElectricity, Float electricCharge, InverterProperties inverterProperties) {
        this.coal = totalElectricity / inverterProperties.getCoalKey();
        this.co2 = totalElectricity / inverterProperties.getCo2();
        this.tree = this.co2 * inverterProperties.getTree();
        this.earnings = totalElectricity * electricCharge;
    }

}
